import React from 'react';
import { StaticRouter } from 'react-router-dom'
import { Provider } from 'mobx-react'
// 引入Router Map
import RouterMap from './router/routers';
import { createStore, createUserStore } from './stores/index'

const createApp = (stores, userStore, context, location) => (
  <Provider {...stores} user={userStore} >
    <StaticRouter context={context} location={location}>
      <RouterMap />
    </StaticRouter>
  </Provider>
)

export default createApp;

export {
  createStore,
  createUserStore,
}
